//
//  TimedEvent.swift
//  Utility
//
//  Created by 何海涛 on 2017/5/24.
//  Copyright © 2017年 何海涛. All rights reserved.
//

import Foundation

extension UIFont {
    
    static public func thinFontWithSize(_ fontSize:CGFloat)->UIFont{
        if #available(iOS 8.2, *) {
            return UIFont.systemFont(ofSize: fontSize, weight: UIFont.Weight.thin)
        } else {
            return UIFont.systemFont(ofSize: fontSize)
        }
    }
    
    public func toThin() -> UIFont {
        return UIFont.thinFontWithSize(self.pointSize)
    }
    
    public func toBold() -> UIFont {
        return UIFont.boldSystemFont(ofSize: self.pointSize)
    }
    
    static public func blackFontWithSize(_ fontSize:CGFloat)->UIFont{
        if #available(iOS 8.2, *) {
            return UIFont.systemFont(ofSize: fontSize, weight: UIFont.Weight.black)
        } else {
            return UIFont.systemFont(ofSize: fontSize)
        }
    }

}
